#!bin/bash
#

mkdir /etc/yum.repos.d/bak
mv /etc/yun.repos.d/*.repo /etc/yum.repos.d/bak

mount /dev/sr0 /mnt &>/del/null
echo "/dev/sro  /mnt  iso9660  defaults  0 0" >> /etc/fstab

cat << eof > /etc/yum.repos.d/local.repo
[centos7.9]
name=centos7.9
baseurl=file:///mnt
enabled=1
gpgcheck=0
eof

yum clean all &> /dev/null
yum repolist
